
//
//  HomePageHappyView.swift
//  民生生活
//
//  Created by apple on 2017/8/8.
//  Copyright © 2017年 youjindi.app.com. All rights reserved.
//

import UIKit

class HomePageHappyView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        layout()
        getData()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func getData() -> Void {
        
    }
    
    func layout() -> Void {
        let titleF = CGRect(x: 0, y: 0, width: ScreenWidth, height: 23)
        let title = HomePageTitleView(titleF, "暑期狂欢")
        self.addSubview(title)
        
        let imageW = (ScreenWidth - 40)/3
        for index in 0..<3{
            let btnFrame = CGRect(x: CGFloat(index) * (imageW + 10) + 10, y: 28, width: imageW, height: 80)
            let btn = UIImageView(frame: btnFrame)
            btn.backgroundColor = UIColor.red
            btn.layer.cornerRadius = 3
            self.addSubview(btn)
        }
        
    }
    
    lazy var viewModel: HomePageViewModel = {
        let viewModel = HomePageViewModel()
        return viewModel
    }()

}
